{% macro form_field(field) %}
    <div class="form-group {% if field.errors %}has-error{% endif %}">
        {{ field.label }}
        {{ field(**kwargs) }}
        {% for message in field.errors %}
        <p class="text-danger">{{ message }}</p>
        {% endfor %}
    </div>
{% endmacro %}